package com.pk.android.view.adapter;

import java.util.List;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

import com.pk.android.model.BaseFragment;

public class ScreenSlidePagerAdapter extends FragmentStatePagerAdapter {
	private List<BaseFragment> fragments;
	//private final FragmentManager mFragmentmanager;
    public ScreenSlidePagerAdapter(FragmentManager fm, List<BaseFragment> fragments) {
        super(fm);
        
        //mFragmentmanager = fm;
        this.fragments = fragments;
    }

    @Override
    public Fragment getItem(int position) {
    	return this.fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments.size();
    }

	@Override
	public CharSequence getPageTitle(int position) {
		// TODO Auto-generated method stub
		
		String title = fragments.get(position).getTitle() == null ? "empty" : fragments.get(position).getTitle(); 
		return title;
	}
	
	@Override
	public int getItemPosition(Object object) {
	    return POSITION_NONE;
	}
	
}